//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include <aura.h>

Aura_Bool AuraTest_VritualMemoryAlloc()
{
    Aura_ECode ec = AURA_NOERROR;
    Aura_Address address = 0;

    ec = AuraVirtualMemory_Map(0, 4*1024,
                           Aura_MemoryMap_Private,
                           Aura_MemoryProtection_Read,
                           &address);
    if (AURA_FAILED(ec)) {
        Aura_printf(" <%s> failed. (ec = 0x%x).\n", __func__, ec);
        return AURA_FALSE;
    }

    Aura_printf(" <%s> address: 0x%08x. \n", __func__, ec);

    ec = AuraVirtualMemory_Unmap(address, 4*1024);
    if (AURA_FAILED(ec)) {
        Aura_printf(" <%s> failed. (ec = 0x%x).\n", __func__, ec);
        return AURA_FALSE;
    }

    return AURA_TRUE;
}
